[#23] Token price display on story page#71
Conversation
Fixes #23 - P5-1a: Create lib/price.ts — reads current token price and reserve balance from MCV2_Bond via priceForNextMint and tokenBond view functions - P5-1b: Display token price and reserve balance on story page header - Uses MCV2_BOND address from lib/contracts/constants.ts (no hardcoding) - Reserve label adapts to testnet (WETH) vs mainnet ($PLOT) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Verified:
- MCV2_BOND and IS_TESTNET correctly imported from constants.ts (no hardcoded addresses)
- Reserve label adapts correctly (WETH/testnet, $PLOT/mainnet)
- Server-side price fetch with graceful null fallback (no price card when bond doesn't exist)
- Parallel multicall for priceForNextMint + tokenBond is efficient
- ABI destructuring correctly skips to reserveToken and reserveBalance fields
Minor note: pricePerToken/reserveBalance could display long decimal strings (e.g. "0.000000000000001234") — consider truncating to 4-6 significant digits in a follow-up for cleaner UX. Not blocking.
Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The PR adds a token price card and uses the shared contract constants correctly, but it does not satisfy the issue acceptance criteria for the second field on the story page.
Findings
- [medium] Issue
#23explicitly calls for displaying the current price and the total supply minted, but the new utility only readsreserveBalancefromtokenBond()and the story page renders that asReserveinstead. That means the required minted-supply value is still missing, so the PR does not fully implement P5-1b.- File:
lib/price.ts:27 - Suggestion: Extend the on-chain read path to fetch the token's minted supply from the appropriate contract/view, return it from
TokenPriceInfo, and render that value on the story page instead of reserve balance.
- File:
Decision
Requesting changes because the story page currently shows the wrong metric for the second data point required by issue #23.
Reads ERC-20 totalSupply() on the storyline token instead of reserveBalance from tokenBond(), matching the issue requirement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Correctly replaced reserve balance with ERC-20 totalSupply on the storyline token — matches issue #23 spec. ABI simplified, interface cleaned up, UI label updated to "Supply Minted". Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The story page now shows the required token price and minted supply metrics, and the implementation still uses the shared contract constants and testnet/mainnet reserve label handling correctly. lint-and-typecheck is passing.
Findings
- none
Decision
Approving because the PR now satisfies issue #23 without the earlier metric mismatch.
Summary
lib/price.ts— reads current token price and reserve balance from MCV2_Bond usingpriceForNextMintandtokenBondview functionslib/contracts/constants.ts(no hardcoding)Fixes #23
Test plan
npm run lintandnpm run typecheckpass🤖 Generated with Claude Code